package com.jie.service.impl;

import com.jie.constant.RedisKey;
import com.jie.pojo.GroupUser;
import com.jie.mapper.GroupUserMapper;
import com.jie.service.GroupUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  群成员类
 * </p>
 *
 * @author xiaojie
 * @since 2023-11-01
 */
@Service
@CacheConfig(cacheNames = RedisKey.IM_CACHE_GROUP_MEMBER_ID)
public class GroupUserServiceImpl extends ServiceImpl<GroupUserMapper, GroupUser> implements GroupUserService {

    @CacheEvict(key="#groupId")
    @Override
    public boolean saveOrUpdateBatch(Long groupId, List<GroupUser> members) {
        return super.saveOrUpdateBatch(members);
    }
}
